package cn.jsl.system.domain;

import cn.jsl.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author jijie
 * @since 2022-06-09
 */
@Data
public class Menu extends BaseDomain{



    private String name;
    private String component;
    private String url;
    private String icon;
    private Integer index;
    private Long parentId;
    private String intro;
    private Boolean state;

    /**
     *  自己的对象,不同部门自己也有层级包含关系,我的上级部门
     */
    private Menu parent;

    /**
     * 保存所有子部门,目前在  部门 新增与添加的 无限极树中用
     * 注解,作用是 没有 子部门的时候,在新增表单中就 不显示 下一级信息
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Menu> children = new ArrayList<>(); // 避免空指针


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public Boolean getState() {
        return state;
    }

    public void setState(Boolean state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "Menu{" +
        ", name=" + name +
        ", component=" + component +
        ", url=" + url +
        ", icon=" + icon +
        ", index=" + index +
        ", parentId=" + parentId +
        ", intro=" + intro +
        ", state=" + state +
        "}";
    }
}
